This invention relates to controlling the supply of available tasks that may be executed by a processor when its work has been temporarily blocked by a conflict with another processor.
Such blocking may happen, for example, when one processor attempts to enter a critical region of code where the other processor is working. (Critical regions are set up to protect data stored in a shared memory against conflicting accesses by two or more processors.) Typically the critical region is protected by a flag in shared memory that is set when a processor is working in the region, and otherwise is cleared. A processor always checks the flag before entering the region, and if it finds the flag set, waits until the other processor has left the region.
In some systems, the waiting processor is assigned to work on other tasks until the critical region becomes free. Switching to such other tasks wastes time because current context information must be stored and recovered again each time another task is done.
Another known approach takes advantage of the fact that in some computers (e.g., Digital Equipment Corporation's VAX) each task is assigned one of, e.g., 32 interrupt priority levels that are ranked according to their relative urgencies and the relative overhead costs of executing them. Generally, when a processor is blocked from working in a critical region having a given interrupt priority level, the blocked processor may service only other tasks having higher interrupt priority levels.